﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Microsoft.Security.Application;

using IdeaNMR.Shared;
using IdeaNMR.Web.Core;

namespace IdeaNMR.Web
{
    public partial class DesignSample : DesignHardObject_BasePage<Sample>
    {
        protected override string PageTitle
        {
            get
            {
                return this.Master.Title;
            }
            set
            {
                this.Master.Title = value;
            }
        }

        protected override void SetValidationParameters()
        {
            base.SetValidationParameters();

            tbLabeling.MaxLength = Sanitar.Labeling.MaxLength;
            rfvLabeling.Text = revLabeling.Text = Sanitar.Labeling.ErrorMsg;
            revLabeling.ValidationExpression = Sanitar.Labeling.ValidationRegex;

            tbBuffer.MaxLength = Sanitar.Buffer.MaxLength;
            rfvBuffer.Text = revBuffer.Text = Sanitar.Buffer.ErrorMsg;
            revBuffer.ValidationExpression = Sanitar.Buffer.ValidationRegex;
        }

        protected override void CollectFormData()
        {
            base.CollectFormData();

            this.HardObjectInfo.EntityObject.Buffer = this.tbBuffer.Text;
            this.HardObjectInfo.EntityObject.Labeling = this.tbLabeling.Text;
        }
        protected override void UpdateFormData()
        {
            base.UpdateFormData();

            this.tbBuffer.Text = this.HardObjectInfo.EntityObject.Buffer;
            this.tbLabeling.Text = this.HardObjectInfo.EntityObject.Labeling;
        }
    }
}